<template>
	<view class="flex-col page">
		<view>
			<view :style="{height:statusBarHeight+44+'px'}"></view>
			<u-navbar title="支付状态" bgColor="#E6EFFF">
				<view slot="left" class="nav-left">
				</view>
			</u-navbar>
		</view>
		<view class="flex-col justify-center items-center item">
			<image src="/static/pay_success.png" style="width: 150rpx;height: 150rpx;"></image>
			<text style="font-size: 38rpx;margin-top: 40rpx;color: red;">{{allPrice()}}</text>
			<view style="font-size: 40rpx;margin-top: 30rpx;font-weight: bold;">支付成功</view>
			
			
			<u-button @click="btnClick" style="margin-top: 200rpx;" type="primary" text="完成" shape="circle"></u-button>
		</view>
		
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showBack:1,
				obj:{}
			};
		},
		computed:{
			statusBarHeight(){
				return this.$store.state.statusBarHeight + 44
			}
		},
		onLoad(op) {
			this.obj = JSON.parse(op.obj)
			console.log(this.obj);
			this.showBack = this.obj.showBack;
		},
		methods:{
			allPrice(){
				if(this.obj.type == 'wechatPay'){
					return '¥' + this.obj.number
				}else if(this.obj.type == 'cloudPay'){
					return '云豆：' + this.obj.number
				}else if(this.obj.type == 'birthPay'){
					return '生日豆：' + this.obj.number
				}else if(this.obj.type == 'assistPay'){
					return '帮扶豆：' + this.obj.number
				}
			},
			
			btnClick(){
				if(this.showBack == 1){ ///小程序
					uni.navigateBack();
				}else{
					uni.switchTab({
						url:'/pages/index/index'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
.page{
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100vh;
	background-color: #fff;
}
.item{
	padding: 100rpx;
}
</style>
